/*
 * clickcheckout.java
 *
 * Created on March 26, 2007, 7:11 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.actions;

import java.util.Random;
import javax.servlet.http.*;
import edu.byu.isys413.group1E.data.*;
import edu.byu.isys413.group1E.handlers.*;

/**This action class sends the transaction information to checkout view, where the user can review thier purchase
 *
 * @author Kendall Frazier
 */
public class clickcheckout implements edu.byu.isys413.web.Action {
    
    /**
     * Creates a new instance of clickcheckout
     */
    public clickcheckout() {
    }
    
    /** 
     *Processes this process directs the browser to the checkout.jsp where the customer can review her order.
     *
     *@param HttpServletRequest
     *@param HttpServletResponse
     *
     *@return String the name of the jsp to call
     */
    public String process(HttpServletRequest request, HttpServletResponse response) throws Exception {
        HttpSession session = request.getSession();
        TransactionDAO TXDAO = TransactionDAO.getInstance();
        TransLineDAO TLDAO = TransLineDAO.getInstance();
        
        //read in the Transaction from the session
        TransactionBO TXBO = (TransactionBO)session.getAttribute("TX");
        
        request.setAttribute("TX", TXBO);
        
        session.setAttribute("TX", TXBO);        
        return "checkout.jsp";
    }//process
    
    
}//clickcheckout class
